Component({
    data: {
      selected: 0,
      color: "#000000",
      roleId: '',
      selectedColor: "#1396DB",
      allList: [{
  
  
        list1:  [{
            "pagePath": "/pages/main_lib/main_lib",
            "text": "首页",
            "iconPath": "/images/tabs/home.png",
            "selectedIconPath": "/images/tabs/home_active.png"
        },
        {
            "pagePath": "/pages/seat_lib/seat_lib",
            "text": "座位",
            "iconPath": "/images/tabs/seat.png",
            "selectedIconPath": "/images/tabs/seat_active.png"
        },
        {
            "pagePath": "/pages/sign_lib/sign_lib",
            "text": "签到",
            "iconPath": "/images/tabs/sign.png",
            "selectedIconPath": "/images/tabs/sign_active.png"
        }
    ],
  
  
  
        list2: [{
            "pagePath": "/pages/main_tea/main_tea",
            "text": "首页",
            "iconPath": "/images/tabs/home.png",
            "selectedIconPath": "/images/tabs/home_active.png"
        }, {
            "pagePath": "/pages/seat_lib/seat_lib",
            "text": "座位",
            "iconPath": "/images/tabs/seat.png",
            "selectedIconPath": "/images/tabs/seat_active.png"
        }, {
            "pagePath": "/pages/sign_lib/sign_lib",
            "text": "签到",
            "iconPath": "/images/tabs/sign.png",
            "selectedIconPath": "/images/tabs/sign_active.png"
        }],

      }],
      list: []
    },
    attached() {
        
      var roleId = getApp().globalUserInfo_tea
      if (roleId == null) {
        this.setData({
          list: this.data.allList[0].list1
        })
      }else{
        this.setData({
          list: this.data.allList[0].list2
        })
        console.log("roleId:"+roleId)

        console.log(this.data.list)
      }
   
      wx.setStorageSync('list', this.data.list)
    },
    methods: {
      switchTab(e) {
       
        const data = e.currentTarget.dataset
        const url = data.path
        wx.switchTab({ url })
        console.log("selected_before:"+this.data.selected);
        console.log("data.index:"+data.index)

        this.setData({
          selected: data.index
        })
        console.log("selected_after:"+this.data.selected);
      }
    },
  
  
  
  })
